package routers

import (
	"hw_admin/controllers"
	"github.com/astaxie/beego"
)

//初始化函数
func init() {
	beego.Router("/index", &controllers.HomeController{})
	//登陆页面
    beego.Router("/admin", &controllers.MainController{})
	//登陆
    beego.Router("/admin/login", &controllers.LoginCotroller{})
	//登出
    beego.Router("/logout", &controllers.LoginCotroller{},"get:Logout")

	//欢迎页面
	beego.Router("/welcome",&controllers.HomeController{},"get:Welcome")

	//用户列表
	beego.Router("/admin/user/list",&controllers.UserController{},"get:List")
	//添加用户页面
	beego.Router("/admin/user/insert_view",&controllers.UserController{},"get:InsertView")
	//用户保存
	beego.Router("/admin/user/insert",&controllers.UserController{},"post:Insert")
	//更新页面
	beego.Router("/admin/user/update_view",&controllers.UserController{},"get:UpdateView")

	//角色列表
	beego.Router("/admin/role/list",&controllers.RoleController{},"get:List")
	//添加界面
	beego.Router("",&controllers.RoleController{},"get:InsertView")
}
